package com.example.demo.day0219;

public class BreakAndContinueInWhile {
    public static void main(String[] args){
        int i=0;
        outer:
        while (true){
            System.out.println("Outer whlie loop");
            while (true){
                i++;
                System.out.println("i="+i);//输出i=+i
                if (i==1){
                    System.out.println("continue");//i=1时输出continue
                    continue ;//跳过下面步骤并继续循环
                }
                if (i==3){
                    System.out.println("continue outer");//i=3时输出continue outer
                    continue outer;//跳过outer接下来的步骤并继续循环
                }
                if (i==5){
                    System.out.println("break");//i=5时输出break
                    break ;//中断循环
                }
                if (i == 7) {
                    System.out.println("break outer");//i=7时输出break outer
                    break outer;//终端outer循环
                }
            }
        }
    }
}
